package tt.dz.biz.service.order;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import tt.dz.biz.dao.order.OrderServiceDAOImpl;
import tt.dz.common.LogUtil;
import tt.dz.vo.OrderServiceVO;
import tt.dz.vo.UserBaseVO;

@Service("orderServiceService")
public class OrderServiceService
{
  @Resource(name="orderServiceDAO")
  private OrderServiceDAOImpl orderServiceDAOImpl;
  
  public List<OrderServiceVO> listAllOrderService()
  {
    List<OrderServiceVO> orderServiceList = null;
    try
    {
      orderServiceList = this.orderServiceDAOImpl.listAllOrderService();
    }
    catch (Exception e)
    {
      LogUtil.error("查询所有订单服务异常", e);
      orderServiceList = new ArrayList();
    }
    return orderServiceList;
  }
  
  public List<OrderServiceVO> listAllCostOrderService()
  {
    List<OrderServiceVO> orderServiceList = null;
    try
    {
      orderServiceList = this.orderServiceDAOImpl.listAllCostOrderService();
    }
    catch (Exception e)
    {
      LogUtil.error("查询所有成本类订单服务异常", e);
      orderServiceList = new ArrayList();
    }
    return orderServiceList;
  }
  
  public List<OrderServiceVO> queryUnAllotOrderService(UserBaseVO userBaseVO)
  {
    List<OrderServiceVO> orderServiceList = null;
    try
    {
      orderServiceList = this.orderServiceDAOImpl.queryUnAllotOrderService(userBaseVO);
    }
    catch (Exception e)
    {
      LogUtil.error("查询当前用户可分配的服务列表异常", e);
      orderServiceList = new ArrayList();
    }
    return orderServiceList;
  }
  
  public List<OrderServiceVO> queryDefaultService()
  {
    try
    {
      return this.orderServiceDAOImpl.queryDefaultService();
    }
    catch (Exception e)
    {
      LogUtil.error("查询用户默认可以使用的服务异常", e);
    }
    return new ArrayList();
  }
}
